package cn.com.simple.learning.designpattern.behavior.command;

/**
 * @author Jianxing.Jia
 * @date 2022/2/9
 * @description 描述信息
 */
public class CommandTest {
    public static void main(String[] args) {
        Light light = new Light();
        RemoteControl controller = new RemoteControl();

        LightOnCommand lightOnCommand = new LightOnCommand(light);
        controller.setCommand(lightOnCommand);
        controller.press();

        LightOffCommand lightOffCommand = new LightOffCommand(light);
        controller.setCommand(lightOffCommand);
        controller.press();
    }
}
